window.onload = function (){
    var info = getQuery("loginError");
    if (info == "noCustom"){
        $('errorDiv').innerHTML = "请以顾客身份登录"
    }
    else if (info == "noManager"){
        $('errorDiv').innerHTML = "请以管理员身份登录"
    }
    else if (info == "noSend"){
        $('errorDiv').innerHTML = "请以收货员身份登录"
    }
}

function login(){
    axios.get("/user/login",{
        params:{
            name:$('name').value,
            pwd:$('pwd').value
        }
    }).then(e => {
        var info = e.data;
        if (info == 'ok'){
            location.href = "/index.html";
        }else {
            $('errorDiv').innerHTML = "登陆失败";
        }
    })
}